<?php
/*=============================================================================
|| ##################################################################
||	phpFoX Konsort
|| ##################################################################
||	
||	Copyright		: (C) 2005-2007 PHPFOX Limited a Reality Fox Creation
||	Contact			: info@phpfox.com
||
||	- phpFoX and all of its source code and files are protected by Copyright Laws. 
||
||	- The license for phpFoX permits you to install this software on a single domain (.com, .org, .net, etc.). 
||
||	- You may also not remove this copyright screen which shows the copyright information and credits for phpFoX (RealityFOX Creations). 
||
||	- phpFoX Konsort is NOT a FREE software - http://www.phpfox.com/license/
||
|| ##################################################################
=============================================================================*/

/* $File: ./include/classes/smarty/plugins/modifier.date_format.php, $Author:  $ */

/**
 * Smarty plugin
 * @package Smarty
 * @subpackage plugins
 */

/**
 * Include the {@link shared.make_timestamp.php} plugin
 */
require_once $smarty->_get_plugin_filepath('shared','make_timestamp');
/**
 * Smarty date_format modifier plugin
 *
 * Type:     modifier<br>
 * Name:     date_format<br>
 * Purpose:  format datestamps via strftime<br>
 * Input:<br>
 *         - string: input date string
 *         - format: strftime format for output
 *         - default_date: default date if $string is empty
 * @link http://smarty.php.net/manual/en/language.modifier.date.format.php
 *          date_format (Smarty online manual)
 *    Monte Ohrt <monte at ohrt dot com>
 * @param string
 * @param string
 * @param string
 * @return string|void
 * @uses smarty_make_timestamp()
 */
function smarty_modifier_date_format($string, $format="%b %e, %Y", $default_date=null)
{
	$iNewTime = strftime($format,$string);
	if ( App::langParam('languagecode') != 'en' )
	{
		$iNewTime = str_replace('Mon ', 'Monday ', $iNewTime);
		$iNewTime = str_replace('Tue ', 'Tuesday ', $iNewTime);
		$iNewTime = str_replace('Wed ', 'Wednesday ', $iNewTime);
		$iNewTime = str_replace('Thu ', 'Thursday ', $iNewTime);
		$iNewTime = str_replace('Fri ', 'Friday ', $iNewTime);
		$iNewTime = str_replace('Sat ', 'Saturday ', $iNewTime);
		$iNewTime = str_replace('Sun ', 'Sunday ', $iNewTime);		
		$iNewTime = str_replace('Jan ', 'January ',$iNewTime);
		$iNewTime = str_replace('Feb ', 'February ',$iNewTime);
		$iNewTime = str_replace('Mar ', 'March ',$iNewTime);
		$iNewTime = str_replace('Apr ', 'April ',$iNewTime);
		$iNewTime = str_replace('Jun ', 'June ',$iNewTime);
		$iNewTime = str_replace('Jul ', 'July ',$iNewTime);
		$iNewTime = str_replace('Aug ', 'August ',$iNewTime);
		$iNewTime = str_replace('Sep ', 'September ',$iNewTime);
		$iNewTime = str_replace('Oct ', 'October ',$iNewTime);
		$iNewTime = str_replace('Nov ', 'November ',$iNewTime);
		$iNewTime = str_replace('Dec ', 'December ',$iNewTime);		
		$iNewTime = str_replace("January",App::format('core.date.january'),$iNewTime);
		$iNewTime = str_replace("February",App::format('core.date.february'),$iNewTime);
		$iNewTime = str_replace("March",App::format('core.date.march'),$iNewTime);
		$iNewTime = str_replace("April",App::format('core.date.april'),$iNewTime);
		$iNewTime = str_replace("May",App::format('core.date.may'),$iNewTime);
		$iNewTime = str_replace("June",App::format('core.date.june'),$iNewTime);
		$iNewTime = str_replace("July",App::format('core.date.july'),$iNewTime);
		$iNewTime = str_replace("August",App::format('core.date.august'),$iNewTime);
		$iNewTime = str_replace("September",App::format('core.date.september'),$iNewTime);
		$iNewTime = str_replace("October",App::format('core.date.october'),$iNewTime);
		$iNewTime = str_replace("November",App::format('core.date.november'),$iNewTime);
		$iNewTime = str_replace("December",App::format('core.date.december'),$iNewTime);		
		$iNewTime = str_replace('Sunday', App::format('sunday'), $iNewTime);
		$iNewTime = str_replace('Monday', App::format('monday'), $iNewTime);
		$iNewTime = str_replace('Tuesday', App::format('tuesday'), $iNewTime);
		$iNewTime = str_replace('Wednesday', App::format('wednesday'), $iNewTime);
		$iNewTime = str_replace('Thursday', App::format('thursday'), $iNewTime);
		$iNewTime = str_replace('Friday', App::format('friday'), $iNewTime);
		$iNewTime = str_replace('Saturday', App::format('saturday'), $iNewTime);
	}	
	return $iNewTime;
}

/* vim: set expandtab: */

?>